package com.ctg.itrdc.imageconsole.data.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.ctg.itrdc.imageconsole.data.dao.IUserClusterAssignDao;
import com.ctg.itrdc.imageconsole.data.entity.UserClusterAssign;
import com.ctg.itrdc.paspsdk.data.dao.impl.BaseDaoImpl;

@Component("userClusterAssignDao")
public class UserClusterAssignDaoImpl extends BaseDaoImpl implements IUserClusterAssignDao {

	@Override
	public void deleteByClusterConfigIdAndRelateUserId(Long clusterConfigId, Long relateUserId) {
		String sql = "DELETE FROM USER_CLUSTER_ASSIGN WHERE RELATE_USER_ID=? AND CLUSTER_CONFIG_ID=?";
		this.getJdbcTemplate().update(sql, relateUserId, clusterConfigId);
	}


	@Override
	public List<UserClusterAssign> getSharesByUserId(Long currentUserId) {
		UserClusterAssign clusterShare = new UserClusterAssign();
		clusterShare.setUserId(currentUserId);
		
		return super.selectByExample(clusterShare);
	}

}
